<?php

class ZFPainel_Tela
{

    /**
     * 
     * @return Zend_Controller_Front
     */
    protected function getController()
    {
        return Zend_Controller_Front::getInstance();
    }

    /**
     * 
     * @return ZFPainel_View_Helper_PageHeader
     */
    protected function getPageHeader()
    {
        return $this->getView()->pageHeader();
    }
    
    protected function getParam($key, $default = null)
    {
        return $this->getController()->getRequest()->getParam($key, $default);
    }

    protected function getParams()
    {
        return $this->getController()->getRequest()->getParams();
    }

    /**
     * 
     * @return Zend_View
     */
    protected function getView()
    {
        return Zend_Layout::getMvcInstance()->getView();
    }
    
    protected function lancarAcessoNegado()
    {
        $exc = new ZFPainel_Exception_Auth_Unauthorized("Acesso negado");
        throw new Zend_Controller_Action_Exception($exc->getMessage(), 403, $exc);
    }

}
